<template>
  <div>
    <template v-for="(item,index) in list">
      <template v-if="item.children">
        <el-submenu :key="index" :index="item.appUrl">
          <template :index="item.appUrl" slot="title">
            <i :class="item.imgUrl"></i>
            <span>{{item.name}}</span>
          </template>
          <el-menu-item-group>
            <zMenu :list="item.children"></zMenu>
          </el-menu-item-group>
        </el-submenu>
      </template>
      <template v-else>
        <el-menu-item :key="index" :index="item.appUrl">
          <i :class="item.imgUrl"></i>
          <span>{{item.name}}</span>
        </el-menu-item>
      </template>
    </template>
  </div>
</template>
<script>
export default {
  name: 'zMenu',
  props: {
    list: Array
  }
}
</script>
<style></style>
